import { Image} from "antd-mobile/2x";
import {Link} from "react-router-dom";
import './NewsItem.scss'
import PropTypes from "prop-types";
const NewsItem = function NewsItem (props = {info :null}){
    const {info} = props
    const { id, title, image, hint} = info
    return (
        <div className="news-item-box">
            <Link to={{pathname:'/detail/'+id}}>
                <div className="content">
                    <h4 className="title">{title}</h4>
                    <p className="author">{hint}</p>
                </div>
                <Image src={image} lazy/>
            </Link>
        </div>
    )
}

NewsItem.propTypes = {
    info:PropTypes.object
}
export default NewsItem